package com.team11.server.controller.admin;

import com.team11.server.pojo.TInformation;
import com.team11.server.service.admin.Admin_Insert_T_Service;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
@CrossOrigin
@RestController
@Api(tags = "管理员接口")
public class Admin_InsertT_Controller {
    @Autowired
    private Admin_Insert_T_Service admin_insert_t_service;
    @ApiOperation("新增教师")
    @PostMapping("/Insert_T")
    public String Insert_teacher(TInformation tInformation){
        String s=admin_insert_t_service.If_have_t(tInformation);
        if (s.equals("1")) {
            return admin_insert_t_service.Insert_T(tInformation);
        }
        else
            return s;
    }
}
